<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/resources/jstl_contexpath.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <title>虎丘婚纱城管理系统</title>
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/bs3/css/bootstrap.min.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/bootstrap-reset.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/font-awesome/css/font-awesome.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/clndr.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/style.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/style-responsive.css" />" />

    <!-- start: CSS -->
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/assets/css/bootstrap.min.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/assets/css/style.min.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/assets/css/retina.min.css" />" />
    <!-- end: CSS -->

    <!-- start: Favicon and Touch Icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="<c:url value="/resources/assets/ico/apple-touch-icon-144-precomposed.png" />" />
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<c:url value="/resources/assets/ico/apple-touch-icon-114-precomposed.png" />" />
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<c:url value="/resources/assets/ico/apple-touch-icon-72-precomposed.png" />" />
    <link rel="apple-touch-icon-precomposed" sizes="57x57" href="<c:url value="/resources/assets/ico/apple-touch-icon-57-precomposed.png" />" />
    <link rel="shortcut icon" href="<c:url value="/resources/assets/ico/favicon.png" />" />
    <!-- end: Favicon and Touch Icons -->

    <style type="text/css">
        div.dataTables_length select {
            width: 178px;
        }
    </style>

    <style type="text/css">
        .jqstooltip {
            position: absolute;
            left: 0px;
            top: 0px;
            visibility: hidden;
            background: rgb(0, 0, 0) transparent;
            background-color: rgba(0, 0, 0, 0.6);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
            -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
            color: white;
            font: 10px arial, san serif;
            text-align: left;
            white-space: nowrap;
            padding: 5px;
            border: 1px solid white;
            z-index: 10000;
        }

        .jqsfield {
            color: white;
            font: 10px arial, san serif;
            text-align: left;
        }
    </style>
    <link rel="stylesheet" href="<c:url value="/resources/css/base.css" />" />
    <link rel="stylesheet" href="<c:url value="/resources/css/hq.css" />" />
</head>
<body>

<!-- start: Header -->
<%@ include file="/resources/head.jsp" %>
<!-- end: Header -->

<div class="container">
    <div class="row">
        <!-- start: Main Menu -->
        <%@ include file="/resources/sidebar.jsp" %>
        <!-- end: Main Menu -->

        <!-- start: Content -->
        <div id="content" class="col-lg-10 col-sm-11">
            <div class="form-top">
                <form action="${ctx}/manage/system/user/index" method="post" class="form-inline form-group form-post">
                    <div class="form-group">
                        <input type="text" class="form-control ng-pristine ng-untouched ng-valid" style="margin-left: -24px" placeholder="管理员名称" name="username" id="username" value="${user_name}">
                    </div>
                    <div class="form-group" style="margin-left: -14px">
                        <button type="submit" class="btn btn-primary">
                            <span class="btn-icon-text">搜索</span>
                        </button>
                    </div>
                </form>
                <div class="form-group">
                    <button type="button" class="btn btn-primary" id="addnew">
                        <i class="icon-base icon-24 icon-btn-add"></i>
                        <span class="btn-icon-text">新增管理员</span>
                    </button>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="box">
                        <div class="box-header">
                            <h2><i class="fa fa-align-justify"></i><span class="break"></span>人员管理</h2>
                            <div class="box-icon">
                            </div>
                        </div>
                        <div class="box-content">
                            <table class="table table-bordered table-striped table-condensed">
                                <thead>
                                    <tr>
                                        <th>用户名</th>
                                        <th>昵称</th>
                                        <th>工号</th>
                                        <th>组织</th>
                                        <th>角色</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                <c:forEach var="people" items="${user_list}" varStatus="peopleStatus">
                                    <tr>
                                        <td>${people.user_name}</td>
                                        <td class="center">${people.nick_name}</td>
                                        <td class="center">${people.employee_id}</td>
                                        <td class="center">${people.org_name}</td>
                                        <td class="center">${people.role_name}</td>
                                        <td class="center">
                                            <c:if test="${people.user_id > user.user_id}">
                                                <button class="btn btn-small btn-primary modify" value="${people.user_id}">编辑</button>
                                                <button class="btn btn-small btn-danger delete" value="${people.user_id}">删除</button>
                                            </c:if>
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>
                            <%@ include file="/resources/page.jsp"%>
                        </div>
                    </div>
                </div><!--/col-->
            </div>
        </div>
    </div>
</div>
<%@ include file="/resources/managerfoot.jsp"%>

<!-- start: JavaScript-->
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery-2.1.0.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery-migrate-1.2.1.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/bootstrap.min.js" />" ></script>

<!-- page scripts -->
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery-ui-1.10.3.custom.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery.sparkline.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery.dataTables.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/dataTables.bootstrap.min.js" />" ></script>

<!-- theme scripts -->
<script type="text/javascript" src="<c:url value="/resources/assets/js/custom.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/core.min.js" />" ></script>

<!-- inline scripts related to this page -->
<script type="text/javascript" src="<c:url value="/resources/assets/js/pages/table.js" />" ></script>

<!-- end: JavaScript-->

<script>
    $('#addnew').click(function(){
        //var choose_org_id = $('#choose_org_id').val();
        window.location.href="${ctx}/manage/system/user/add";
    });
    $('.modify').click(function(){
        var edited_user_id = $(this).val();
        window.location.href="${ctx}/manage/system/user/edit?edited_user_id="+edited_user_id;
    })
    $('.delete').click(function(){
        if(confirm("确定要删除吗？")) {
            var edited_user_id = $(this).val();
            alert(edited_user_id);
            <%--$.ajax({--%>
                <%--url:"${ctx}/manage/system/user/dodelete",--%>
                <%--type: "post",--%>
                <%--data:{edited_user_id:edited_user_id},--%>
                <%--success:function(data){--%>
                    <%--if(data > 0){--%>
                        <%--alert("成功");--%>
                        <%--location.reload();--%>
                    <%--} else {--%>
                        <%--alert("失败");--%>
                        <%--return false;--%>
                    <%--}--%>
                <%--}--%>
            <%--})--%>
        }
    })
</script>

</body>
</html>